﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Centny.PdfReader.Types;

namespace Centny.PdfReader.Pdf
{
    public class PdfObject : PdfClass, PdfIDocumentVisible, PdfIReferencable
    {
        public PdfDocument Doc { get; set; }

        public long Num { get; set; }

        public long ModifyTimes { get; set; }

        public string Obj { get; set; }

        //public List<PdfClass> SubObjs { get; set; }
        //public PdfDictionary Elements { get; set; }
        //public PdfStream Stream { get; set; }

        public PdfObject()
        {
            //this.SubObjs = new List<PdfClass>();
        }
        public override string ToString()
        {
            return this.Num + " " + this.ModifyTimes + " " + this.Obj;
        }
        public override int GetHashCode()
        {
            return this.Num.GetHashCode();
        }
        public override bool Equals(object obj)
        {
            PdfObject po= obj as PdfObject;
            if (po==null)
            {
                return false;
            }
            return this.Num.Equals(po.Num) && this.ModifyTimes.Equals(po.ModifyTimes) && this.Obj.Equals(po.Obj);
        }
    }
}
